import React, { Component } from 'react'
import Item from '../Item'
import './index.css'
export default class List extends Component {
    render() {
        const {data:userDatas,isFirst,isLoading,err} = this.props
        return (
            <div className="row">
                {
                    isFirst ? <h2>欢迎使用，输入搜索</h2> : 
                    isLoading ? <h2>Loading...</h2> :
                    err ? <h2 style={{color: 'red'}}>{err}</h2> :
                    userDatas.length ===  0 ? <h2>没有该用户名</h2> :
                   userDatas.map(userData => <Item key={userData.id} {...userData}/>)
                }
            </div>
        )
    }
}
